package com.dr.service.impl;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dr.mapper.InvoiceMapper;
import com.dr.pojo.Invoice;
import com.dr.service.InvoiceService;

@Service
@Transactional //激活事务处理
public class InvoiceServiceImpl implements InvoiceService {

	@Autowired
	private InvoiceMapper mapper;
	
	@Override
	public Invoice nextInvoice() {   //取得最新发票号
		// TODO Auto-generated method stub
		return mapper.nextInvoice();
	}

	@Override
	public List<Invoice> findInvoiceList() {
		// TODO Auto-generated method stub
		return mapper.findInvoiceList();
	}

	@Override
	public int updateInvoice(@Param("id")Integer id,@Param("invoiceNum") String invoiceNum) {
		// TODO Auto-generated method stub
		return mapper.updateInvoice(id, invoiceNum);
	}

	@Override
	public String thisInvoice() {
		// TODO Auto-generated method stub
		return mapper.thisInvoice();
	}

}
